package com.wanxi.enterprise.api.feign;

import com.wanxi.enterprise.api.dto.EnterpriseUpdateInDTO;
import com.wanxi.enterprise.api.dto.LocateDataFindByIdOutDTO;
import com.wanxi.enterprise.api.query.EnterpriseQuery;
import com.wanxi.enterprise.api.query.LocateApplyQuery;
import com.wanxi.enterprise.api.query.ShopQuery;
import com.wanxi.enterprise.api.result.CommonResult;
import com.wanxi.enterprise.api.vo.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "enterprise-service")
public interface EnterpriseFeignCilent {

    /**
     * @author jinfang
     * @Description //管理员查看商家基本信息（商家表+入驻资料表）
     * @Date  2022/1/8
     * @param enterpriseQuery
     * @return CommonResult
     **/
    @GetMapping("admin/findEnterpriseAll")
    CommonResult<List<EnterpriseFindAllOutVo>> findAll(@RequestBody EnterpriseQuery enterpriseQuery);

    /**
     * @author jinfang
     * @Description //管理员查看商家入驻信息，方便审核
     * @Date  2022/1/8
     * @param locateApplyQuery
     * @return CommonResult
     **/
    @GetMapping("admin/findApplyAll")
    CommonResult<List<LocateApplyFindAllOutVO>> findApplyAll(@RequestBody LocateApplyQuery locateApplyQuery);

    /**
     * @Author jinfang
     * @Description // 管理员点击审核通过，并录入到入驻资料表
     * @Date  2022/1/7
     * @Params locateApplyAuditInVo
     * @return CommonResult
     **/
    @PutMapping("admin/addApplyData")
    CommonResult updateApply(@RequestBody LocateApplyAuditInVo locateApplyAuditInVo);

    /**
     * @Author jinfang
     * @Description // 管理员点击审核驳回，并且通过邮箱方式返回驳回理由给商家
     * @Date  2022/1/13
     * @Params locateApplyAuditInVo
     * @return CommonResult
     **/
    @GetMapping("admin/noApply")
    CommonResult noApply(@RequestBody NoLocateApplyInVO noLocateApplyInVO);

    /**
     * @Author jinfang
     * @Description // 管理员更新商家入驻状态
     * @Date  2021/1/20
     * @Params id
     * @return CommonResult
     **/
    @PutMapping("admin/updateLocateStatus")
    CommonResult updateLocateStatus(@RequestBody NoLocateApplyInVO noLocateApplyInVO);

    /**
     * @Author jinfang
     * @Description // 商家完善自己的商家信息（从游客角色转换为商家）
     * @Date  2022/1/6
     * @Params enterpriseAddInVo
     * @return CommonResult
     **/
    @PostMapping("enterprise/addEnterprise")
    CommonResult addEnterprise(@RequestBody EnterpriseAddInVo enterpriseAddInVo);

    /**
     * @Author jinfang
     * @Description // 商家申请入驻，输入入驻资料，添加商家资料到入驻申请表
     * @Date  2022/1/6
     * @Params locateApplyAddInVo
     * @return CommonResult
     **/
    @PostMapping("enterprise/addApply")
    CommonResult addApply(@RequestBody LocateApplyAddInVo locateApplyAddInVo);

    /**
     * @Author jinfang
     * @Description // 商家查看自己的入驻信息
     * @Date  2022/1/13
     * @Params id
     * @return CommonResult
     **/
    @GetMapping("enterprise/findApplyDataById")
    CommonResult<LocateDataFindByIdOutDTO> findApplyDataById(@RequestParam("id") Long id);

    /**
     * @Author jinfang
     * @Description // 商家根据id修改自己的信息
     * @Date  2022/1/6
     * @Params enterpriseUpdateInDTO
     * @return CommonResult
     **/
    @PutMapping("enterprise/updateEnterpriseById")
    CommonResult updateEnterpriseById(@RequestBody EnterpriseUpdateInDTO enterpriseUpdateInDTO);

    /**
     * @Author jinfang
     * @Description // 商家添加店铺
     * @Date  2021/1/10
     * @Params shopAddInVo
     * @return CommonResult
     **/
    @PostMapping("enterprise/addShop")
    CommonResult addShop(@RequestBody ShopAddInVo shopAddInVo);

    /**
     * @Author jinfang
     * @Description // 商家查看旗下的店铺列表
     * @Date  2021/1/10
     * @Params shopQuery
     * @return CommonResult
     **/
    @GetMapping("enterprise/findShopAll")
    CommonResult<List<ShopFindAllOutVo>> findShopAll(@RequestBody ShopQuery shopQuery);

    /**
     * @Author jinfang
     * @Description // 商家根据id查看店铺
     * @Date  2021/1/10
     * @Params id
     * @return CommonResult
     **/
    @GetMapping("enterprise/findShopById")
    CommonResult<ShopFindByIdOutVo> findShopById(@RequestParam("id") Long id);

    /**
     * @Author jinfang
     * @Description // 商家修改店铺信息
     * @Date  2021/1/10
     * @Params shopUpdateInVo
     * @return CommonResult
     **/
    @PutMapping("enterprise/updateShopById")
    CommonResult updateShop(@RequestBody ShopUpdateInVo shopUpdateInVo);

    /**
     * @Author jinfang
     * @Description // 商家逻辑删除店铺
     * @Date  2021/1/10
     * @Params id
     * @return CommonResult
     **/
    @PutMapping("enterprise/deleteShopById")
    CommonResult deleteShopById(@RequestParam("id") Long id);


}
